#e
#Title[u`EIuEtBAv]
#Text[]
#ScriptVersion[2]

script_enemy_main
{//Enemy01
	let count=0;
	let p=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgExRumiaBack=GetCurrentScriptDirectory~"img\ExRumiaBack.png";
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,8);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(300);
		
		LoadGraphic(imgExRumia);	
		LoadGraphic(imgExRumiaBack);

		SetMovePosition02(cx,120,60);
		Concentration01(60);
		CutIn(YOUMU,"u`EIuEtBAv",0,0,0,0,0);//XyJ[h\
	}
	@MainLoop
	{
		let s=0;
		let base =0;
		if(count>=1)
		{
			if(count%60==0)
			{
				let angle=rand(0,360);
				loop(30)
				{
					SetShotDirectionType(SEQUENCE);
					CreateShotA(s,GetX,GetY,0);	
					SetShotDataA(s,0,3,angle,0,0,2,89);
					SetShotDataA(s,30,1,90,0,0,2,89);
					FireShot(s);
					angle+=6;
				}
				loop(30)
				{
					SetShotDirectionType(SEQUENCE);
					CreateShotA(s,GetX,GetY,0);	
					SetShotDataA(s,0,3,angle,0,0,2,94);
					SetShotDataA(s,30,1,-90,0,0,2,94);
					FireShot(s);
					angle+=6;
				}
			}
			SetCollisionA(GetX(),GetY(),24);//蔻(e)o^
			SetCollisionB(GetX(),GetY(),24);//蔻(̓)o^
			SetPlayerX(GetPlayerX+rand(-2,2));
			SetPlayerY(GetPlayerY+rand(-2,2));
		}
	count++;

	}
	@Finalize
	{//ǂ݂񂾃t@C폜
		loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
	}
	
	@DrawLoop
	{
		//Ex[~A`
		if(count<270){SetGraphicRect(64,64,127,127)};
		if(count>=270){SetGraphicRect(1,1,64,64);}
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}
}